<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var str=' hello ';
			function trim(str){
				var re=/^\s+|\s+$/g;
				return str.replace(re,'');
			};
			alert('('+trim(str)+')');
		</script>
	</body>
</html>
